package gitobject;

import repository.Repository;

import java.util.ArrayList;

//头指针 ，子节点为每一个Commit,指向每一次更改【
public class Head extends GitObject{
    protected ArrayList<GitObject> branchList = new ArrayList<>();
    protected Branch currentBranch = new Branch();

    public ArrayList<GitObject> getBranchList(){return branchList;}
    public Branch getCurrentBranch(){return currentBranch;}
    public Head() {}
   // public Head(Branch branch){}

    public Head(String branch){
    //    currentBranch = branch;
    //    branchList.add(branch);
        this.path = Repository.getGitDir();
        //HEAD文件位置为.getGitDir()
        this.key = "HEAD";
        this.value = "refs/heads/" + branch;//branch.getName();
    }
}

